Closed
Use current AKS Kubernetes version in generated config#200
Conversation
Copilot
AI
changed the title
[WIP] Fix generate-node-config to use currentKubernetesVersion
Use current AKS Kubernetes version in generated config
Jun 19, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the aks-flex-config generate-node-config helper to always use the resolved AKS patch Kubernetes version (via currentKubernetesVersion) when generating the Flex Node config, ensuring downstream Kubernetes binary downloads can target a concrete version from dl.k8s.io.
Changes:
- Switch cluster metadata lookup from
currentKubernetesVersion || kubernetesVersiontocurrentKubernetesVersiononly. - Add a focused Python unittest to assert metadata generation uses
currentKubernetesVersionand preserves a full semver patch value.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
scripts/aks-flex-config |
Updates AKS metadata query to use currentKubernetesVersion for components.kubernetes. |
scripts/aks_flex_config_test.py |
Adds a unit test validating the script queries currentKubernetesVersion and returns the patch version. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
138
to
141
| "kubernetes_version": run( | ||
| ["az", "aks", "show", *aks, "--query", "currentKubernetesVersion || kubernetesVersion", "-o", "tsv"], | ||
| ["az", "aks", "show", *aks, "--query", "currentKubernetesVersion", "-o", "tsv"], | ||
| capture=True, | ||
| ), |
Comment on lines
+29
to
+47
| self.assertEqual(metadata["kubernetes_version"], "1.34.8") | ||
| run.assert_any_call( | ||
| [ | ||
| "az", | ||
| "aks", | ||
| "show", | ||
| "--resource-group", | ||
| "rg", | ||
| "--name", | ||
| "cluster", | ||
| "--subscription", | ||
| "sub", | ||
| "--query", | ||
| "currentKubernetesVersion", | ||
| "-o", | ||
| "tsv", | ||
| ], | ||
| capture=True, | ||
| ) |
Comment on lines
+1
to
+6
| import argparse | ||
| import importlib.machinery | ||
| import importlib.util | ||
| from pathlib import Path | ||
| import unittest | ||
| from unittest import mock |
bcho
requested changes
Jun 19, 2026
| @@ -0,0 +1,51 @@ | |||
| import argparse | |||
Contributor
Author
There was a problem hiding this comment.
Done in e283564: removed scripts/aks_flex_config_test.py.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
generate-node-configwas readingkubernetesVersion, which may be a major/minor alias like1.34.aks-flex-nodeneeds the resolved patch version, e.g.1.34.8, to download Kubernetes binaries fromdl.k8s.io.currentKubernetesVersionfromaz aks showforcomponents.kubernetes.kubernetesVersion, which can produce non-downloadable versions."currentKubernetesVersion"